﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace NotificationCenterSample.Migrations;

public partial class modifyNotificationSubscription : Migration
{
    protected override void Up(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.DropPrimaryKey(
            name: "PK_AbpNotificationSubscriptions",
            table: "AbpNotificationSubscriptions");

        migrationBuilder.AlterColumn<string>(
            name: "EntityId",
            table: "AbpNotificationSubscriptions",
            type: "nvarchar(128)",
            maxLength: 128,
            nullable: true,
            oldClrType: typeof(string),
            oldType: "nvarchar(128)",
            oldMaxLength: 128);

        migrationBuilder.AlterColumn<string>(
            name: "EntityTypeName",
            table: "AbpNotificationSubscriptions",
            type: "nvarchar(256)",
            maxLength: 256,
            nullable: true,
            oldClrType: typeof(string),
            oldType: "nvarchar(256)",
            oldMaxLength: 256);

        migrationBuilder.AddPrimaryKey(
            name: "PK_AbpNotificationSubscriptions",
            table: "AbpNotificationSubscriptions",
            column: "Id");
    }

    protected override void Down(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.DropPrimaryKey(
            name: "PK_AbpNotificationSubscriptions",
            table: "AbpNotificationSubscriptions");

        migrationBuilder.AlterColumn<string>(
            name: "EntityTypeName",
            table: "AbpNotificationSubscriptions",
            type: "nvarchar(256)",
            maxLength: 256,
            nullable: false,
            defaultValue: "",
            oldClrType: typeof(string),
            oldType: "nvarchar(256)",
            oldMaxLength: 256,
            oldNullable: true);

        migrationBuilder.AlterColumn<string>(
            name: "EntityId",
            table: "AbpNotificationSubscriptions",
            type: "nvarchar(128)",
            maxLength: 128,
            nullable: false,
            defaultValue: "",
            oldClrType: typeof(string),
            oldType: "nvarchar(128)",
            oldMaxLength: 128,
            oldNullable: true);

        migrationBuilder.AddPrimaryKey(
            name: "PK_AbpNotificationSubscriptions",
            table: "AbpNotificationSubscriptions",
            columns: new[] { "UserId", "NotificationName", "EntityTypeName", "EntityId" });
    }
}
